//
//  UpView.m
//  FoodCorner
//
//  Created by lanou3g on 16/2/27.
//  Copyright © 2016年 zhangchao. All rights reserved.
//

#import "UpView.h"
#import "UpChildOneView.h"
#import "UpChildTwoView.h"

@interface UpView ()
@property (nonatomic ,strong)UpChildOneView *upChildOneView;
@property (nonatomic ,strong)UpChildTwoView *upChildTwoView;

@end


@implementation UpView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
//        self.backgroundColor = [UIColor purpleColor];
        [self andSubView];
    }
    return self;
}
- (void)andSubView{
    
    self.upChildOneView = [[UpChildOneView alloc]init];
    
    self.upChildOneView.backgroundColor = [UIColor lightGrayColor];

    self.upChildTwoView = [[UpChildTwoView alloc]init];
//    self.upChildTwoView.backgroundColor = [UIColor brownColor];
//    NSLog(@"----%@",[NSValue valueWithCGRect:self.upChildOneView.labOne.frame]);
    
    [self addSubview:_upChildOneView];
    [self addSubview:_upChildTwoView];
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.upChildOneView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height*0.66);
    self.upChildTwoView.frame = CGRectMake(0, CGRectGetMaxY(self.upChildOneView .frame), self.frame.size.width, self.frame.size.height*0.34);
    

}
@end
